package com.qms.tubu.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;

/**
 * Created by Mad on 2015/7/17.
 */
public class ResizeImageView extends ImageView{
    public ResizeImageView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        int width=getMeasuredWidth();
        int height= (int) (width*9f/16f*1.2f);
        setMeasuredDimension(width,height);
    }
}
